]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Group chat sources on the left in the message tray
authorHellyna Ng <hellyna@hellyna.com>
Thu, 30 Dec 2010 21:09:56 +0000 (05:09 +0800)
committerMarina Zhurakhinskaya <marinaz@redhat.com>
Tue, 1 Feb 2011 20:29:14 +0000 (15:29 -0500)
This will make it easier for users to get back to their chats.

https://bugzilla.gnome.org/show_bug.cgi?id=617234

js/ui/messageTray.js
js/ui/telepathyClient.js

index 1812983d961d4a720f1de96128b5625efbd261ed..aa1bdd13f4e44694186d3a992141a6b416a64be7 100644 (file)
@@ -806,6 +806,7 @@ Source.prototype = {
         this._iconBin = new St.Bin({ width: this.ICON_SIZE,
                                      height: this.ICON_SIZE });
         this.isTransient = false;
+        this.isChat = false;
     },
 
     setTransient: function(isTransient) {
@@ -1025,6 +1026,7 @@ MessageTray.prototype = {
         // added to the summary without a notification being shown.
         this._newSummaryItems = [];
         this._longestSummaryItem = null;
+        this._chatSummaryItemsCount = 0;
     },
 
     _setSizePosition: function() {
@@ -1058,7 +1060,12 @@ MessageTray.prototype = {
 
         let summaryItem = new SummaryItem(source);
 
-        this._summary.insert_actor(summaryItem.actor, 0);
+        if (source.isChat) {
+            this._summary.insert_actor(summaryItem.actor, 0);
+            this._chatSummaryItemsCount++;
+        } else {
+            this._summary.insert_actor(summaryItem.actor, this._chatSummaryItemsCount);
+        }
 
         let titleWidth = summaryItem.getTitleNaturalWidth();
         if (titleWidth > this._summaryItemTitleWidth) {
@@ -1123,6 +1130,10 @@ MessageTray.prototype = {
             this._newSummaryItems.splice(newSummaryItemsIndex, 1);
 
         this._summaryItems.splice(index, 1);
+
+        if (source.isChat)
+            this._chatSummaryItemsCount--;
+
         if (this._longestSummaryItem.source == source) {
             let newTitleWidth = 0;
             this._longestSummaryItem = null;
index ed8feae7d5aa33b3a41178078049e7c095ff055b..8dcbfed5ad60cb92f0a8803a5ace12486bf6efca 100644 (file)
@@ -455,6 +455,8 @@ Source.prototype = {
     _init: function(accountPath, connPath, channelPath, targetHandle, targetHandleType, targetId) {
         MessageTray.Source.prototype._init.call(this, targetId);
 
+        this.isChat = true;
+
         this._accountPath = accountPath;
 
         let connName = Telepathy.pathToName(connPath);